package com.yj.web.util.json;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yj.web.WeChat.Bean.WxAccessToken;
import com.yj.web.util.WxError;

/**
 * Created by yanlinyang on 2017/9/10.
 */
public class WxGsonBuilder {
    public static final GsonBuilder INSTANCE = new GsonBuilder();

    static {
        INSTANCE.disableHtmlEscaping();
        INSTANCE.registerTypeAdapter(WxAccessToken.class, new WxAccessTokenAdapter());
        INSTANCE.registerTypeAdapter(WxError.class, new WxErrorAdapter());
//        INSTANCE.registerTypeAdapter(WxMenu.class, new WxMenuGsonAdapter());
//        INSTANCE.registerTypeAdapter(WxMediaUploadResult.class, new WxMediaUploadResultAdapter());
    }
    public static Gson create() {
        return INSTANCE.create();
    }
}
